package com.xishu.entity.comment;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

@Table(name = "comment")
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Comment extends AbstractEntity implements Serializable {
    private static final long serialVersionUID = 1645254128684535257L;

    @ApiModelProperty("菜品id")
    private Long productId;

    @ApiModelProperty("shopId")
    private Long shopId;

    @ApiModelProperty("评论人姓名")
    private String customerName;

    @ApiModelProperty("评论人id")
    private Long customerId;

    @ApiModelProperty("父级评论id 0-自己的评论 ")
    private Long parentCommentId;

    @ApiModelProperty("评论内容")
    private String content;

    @ApiModelProperty("子评论")
    @Transient
    private List<Comment> children;

    @ApiModelProperty("评论类型 0-商店评论 1-菜品评论")
    private Integer type;

    @ApiModelProperty("头像")
    private String headImg;

    @ApiModelProperty("点赞人数")
    @DefaultValue(defaultValue = "0")
    private Integer likeCount;

}
